#pragma once

#include "Business/Dealing.h"

namespace sqlite3x {
	class connection;
}

class DealingRepository
{
public:

	static DealingRepository& Instance();

	DealingRepository();
//	DealingRepository(sqlite3x::connection& dbConnection);
	~DealingRepository();

	Dealing& Save(Dealing const& dealing);

	Dealing* Get(int localId);

private:

	void Insert(Dealing const& dealing);
	void Update(Dealing const& dealing);
	bool IsExist(int localId) const;
	void Create();

	//sqlite3x::connection& m_dbConnection;
	std::map<int,Dealing> m_dealings;
};
